package com.eyas.im.server;

import java.io.IOException;
import java.net.SocketAddress;

/**
 * IM系统server端实现
 */
public interface IMServer {
    enum SERVERSTATUS {
        READY,
        START,
        CLOSED
    }
    /**
     * 启动Server
     */
    void startUp() throws IOException;

    /**
     * 安全的关闭server端，保证最后一次accept的连接能够正常关闭
     */
    void shudownGraceful();

    /**
     * 获取server服务绑定的IP和port信息
     * @return
     * @throws IOException  server服务关闭
     */
    SocketAddress getSocketAddress() throws IOException;
}
